#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableEquipmentDao:DaoBase<TableEquipment>
    {
        public override string GetFileName()
        {
            return "TableEquipment.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableEquipment>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableEquipment model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.equipId)) UnityEngine.Debug.LogError("数据表id重复:TableEquipment->id: " + model.equipId);
            #endif
            cachePrimaryInt[model.equipId] = model;
        }
        protected override TableEquipment ParseRowData(string[] rowData)
        {
            TableEquipment data = new TableEquipment();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.equipId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.equipType = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.bagType = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.name = string.Intern(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.intro = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.icon = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.useLevel = int.Parse(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.equipPosition = int.Parse(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.equipQuality = int.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.suitId = int.Parse(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.isStatic = int.Parse(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.mainPropId = rowData[11];
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.staticPropId = string.Intern(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.randPropId = string.Intern(rowData[13]);
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.rarePropId = rowData[14];
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.resource = rowData[15];
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.canDeal = int.Parse(rowData[16]);
            }
            if (!string.IsNullOrEmpty(rowData[17]))
            {
                data.canSell = int.Parse(rowData[17]);
            }
            if (!string.IsNullOrEmpty(rowData[18]))
            {
                data.currencyType = int.Parse(rowData[18]);
            }
            if (!string.IsNullOrEmpty(rowData[19]))
            {
                data.sellPrice = int.Parse(rowData[19]);
            }
            if (!string.IsNullOrEmpty(rowData[20]))
            {
                data.bindType = int.Parse(rowData[20]);
            }
            if (!string.IsNullOrEmpty(rowData[21]))
            {
                data.sortIndex = int.Parse(rowData[21]);
            }
            if (!string.IsNullOrEmpty(rowData[22]))
            {
                data.holeColor = string.Intern(rowData[22]);
            }
            if (!string.IsNullOrEmpty(rowData[23]))
            {
                data.cantoWarehourse = int.Parse(rowData[23]);
            }
            if (!string.IsNullOrEmpty(rowData[24]))
            {
                data.buyBackType = int.Parse(rowData[24]);
            }
            if (!string.IsNullOrEmpty(rowData[25]))
            {
                data.buyBackPrice = int.Parse(rowData[25]);
            }
            if (!string.IsNullOrEmpty(rowData[26]))
            {
                data.bindBtn = int.Parse(rowData[26]);
            }
            if (!string.IsNullOrEmpty(rowData[27]))
            {
                data.isCanDecompose = int.Parse(rowData[27]);
            }
            if (!string.IsNullOrEmpty(rowData[28]))
            {
                data.decomposeGet = rowData[28];
            }
            return data;
        }
    }
}
